
$(document).ready(function(){ 
    getCampaign(); 
    $("#edit-organization").change(function(){ 
        getCampaign(); 
    }); 
    
    
}); 

function getCampaign(){ 
    var pageUrl = 'http://' + document.domain;
    var orgId = $("#edit-organization").val();
    $.getJSON( pageUrl + '/fundraising/order_export/reports/get_cam_list/'+orgId, function(json){
        $("option",$("#edit-campaign")).remove(); 

        $.each(json,function(index,array){ 
            var option = "<option value='"+array['id']+"'>"+array['title']+"</option>"; 
            $("#edit-campaign").append(option); 
        }); 
    }); 
}
